﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel.Web;

namespace MSMART
{

    public class clsCaseCreator : System.Web.Services.WebService
    {
        public enum casetype
        {
            Delivery = 1001,
            Return = 1002
        }
        public struct caseDetails
        {
            public int branch_id;
            public int asset_id;
            public DateTime time;
        }
        public struct leaseDetails
        {
            public int customer_id;
            public int address_id; 
            public DateTime transactiondate;
            public int contract_id; 
        }
        
        [System.Web.Services.WebMethod(Description="Allows you to create a case in MSMART. Returns case details", MessageName="Get Case Details")]
        public caseDetails createCase(casetype caseType, leaseDetails ld){

            Console.WriteLine("{0},{1},{2},{3},{4}", caseType, ld.customer_id, ld.address_id, ld.transactiondate.ToString(), ld.contract_id);
            caseDetails cd = new caseDetails();
            cd.time = ld.transactiondate;
            cd.branch_id = 2044;
            cd.asset_id = 23;
            return cd;

            
            
        }
    }
}
